import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";

/** @type {import('eslint').Linter.Config[]} */
export default [
	{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
	{ languageOptions: { globals: globals.browser } },
	pluginJs.configs.recommended,
	...tseslint.configs.recommended,
	pluginReact.configs.flat.recommended,
	{
		rules: {
			"no-console": "error",
			"react/react-in-jsx-scope": "off",
			"react/jsx-uses-react": "off",
		},
	},
	{
		ignores: [
			"apps/**/*/{tmp,.dumi}/**/*",
			"*.js",
			"**/*/build/**/*",
			"**/*/es/**/*",
			"**/*/dist/**/*",
		],
	},
];
